package com.zlm.mall.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zlm.common.utils.PageUtils;
import com.zlm.mall.product.entity.AttrEntity;
import com.zlm.mall.product.vo.AttrGroupRelationVo;
import com.zlm.mall.product.vo.AttrRespVo;
import com.zlm.mall.product.vo.AttrVo;

import java.util.List;
import java.util.Map;

/**
 * 商品属性
 *
 * @author zlm
 * @email
 * @date 2020-07-22 17:14:28
 */
public interface AttrService extends IService<AttrEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void saveAttr(AttrVo attr);

    PageUtils queryBaseAttr(Map<String, Object> params, Long catelogId, String type);

    AttrRespVo getAttrInfo(Long attrId);

    void updateAttr(AttrRespVo attr);

    /**
     * 根据分组id查询所有的关联基本属性
     * @param attrgroupId
     * @return
     */
    List<AttrEntity> getRelationAttr(Long attrgroupId);

    void deleteRelation(AttrGroupRelationVo[] vos);

    /**
     * 查询当前分组未关联的所有属性
     * @param params
     * @param attrgroupId
     * @return
     */
    PageUtils getNoattrRelation(Map<String, Object> params, Long attrgroupId);

    /**
     * 查询被检索的规格属性
     * @param attrIds
     * @return
     */
    List<Long> selectSearchAttrIds(List<Long> attrIds);
}

